import { IsOptional, IsString, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class UpdatePermissionDto {
  @ApiProperty({
    description: '权限编码',
    required: false,
    example: 'user:create',
  })
  @IsString()
  @IsOptional()
  @Length(2, 50)
  code?: string;

  @ApiProperty({
    description: '权限描述',
    required: false,
    example: '创建用户权限',
  })
  @IsString()
  @IsOptional()
  description?: string;
}
